// 网站标题控制
let routerTitle = '';
let siteTitle = '';
function setTitle() {
    if (!routerTitle && !siteTitle) {
        document.title = 'loading...';
        return;
    } else if (!routerTitle && siteTitle) {
        document.title = siteTitle;
    } else if (routerTitle && !siteTitle) {
        document.title = 'loading...';
    } else {
        document.title = `${routerTitle} - ${siteTitle}`;
    }
}
export default {
    // 设置路由标题

    setRouterTitle(title) {
        routerTitle = title;
        setTitle();

    },
    //设置网站标题
    setSiteTitle(title) {
        siteTitle = title;
        setTitle();
    }
}